from google.appengine.ext import db

class MasterControlProject(db.Model):
    pivotal_project_id = db.IntegerProperty(required = True)
    name = db.StringProperty(required = True, default = '')
    updated = db.DateTimeProperty(auto_now = True)
    owner = db.UserProperty(auto_current_user_add = True)
    token = db.StringProperty(required = True)
    activities_processed = db.IntegerProperty(required = False)

class MasterControlSubProject(db.Model):
    master_project = db.ReferenceProperty(MasterControlProject, collection_name = 'subprojects')
    pivotal_project_id = db.IntegerProperty(required = True)
    name = db.StringProperty(required = True, default = '')
    updated = db.DateTimeProperty(auto_now = True)
    token = db.StringProperty(required = False)
    integration_name = db.StringProperty(required = True, default = 'MasterControl')
    label = db.StringProperty(required = True)
    old_labels = db.ListProperty(basestring)
    owning_user_name = db.StringProperty(required = True)
    activities_processed = db.IntegerProperty(required = False)

